import 'package:flutter/material.dart';
import 'package:flutter/widgets.dart';

import '../components/PageWrap.dart';

class ImageAndIconLn extends StatefulWidget {
  const ImageAndIconLn({super.key});

  @override
  State<ImageAndIconLn> createState() => _ImageAndIconLnState();
}

class _ImageAndIconLnState extends State<ImageAndIconLn> {
  @override
  Widget build(BuildContext context) {
    var img=AssetImage("images/1.jpg");
    return PageWrap(
      title:"图片及ICON",
      children:<Widget>[
        Row(
          mainAxisAlignment: MainAxisAlignment.start,
          children: <Widget>[
            Icon(Icons.accessible,color: Colors.green),
            Icon(Icons.error,color: Colors.green),
            Icon(Icons.fingerprint,color: Colors.green),
          ],
        )
        ,...[
          Image(image: AssetImage("images/1.jpg"), width: 100.0),
          Image.asset(
            "images/1.jpg",
            width: 100.0,
          ),
          Image(
            image: NetworkImage(
                "http://blog.cdn.suzhidong.cn/1714372000560-b5ee1a34-c4d9-4e17-a62e-38a51443d1fe.png"),
            width: 100.0,
          ),
          Image.network(
            "http://blog.cdn.suzhidong.cn/1714372000560-b5ee1a34-c4d9-4e17-a62e-38a51443d1fe.png",
            width: 100.0,
          ),
          //Image在显示图片时定义了一系列参数，通过这些参数我们可以控制图片的显示外观、大小、混合效果等。
          Image(
            image: img,
            height: 50.0,
            width: 100.0,
            fit: BoxFit.fill,
          ),
          Image(
            image: img,
            height: 50,
            width: 50.0,
            fit: BoxFit.contain,
          ),
          Image(
            image: img,
            width: 100.0,
            height: 50.0,
            fit: BoxFit.cover,
          ),
          Image(
            image: img,
            width: 100.0,
            height: 50.0,
            fit: BoxFit.fitWidth,
          ),
          Image(
            image: img,
            width: 100.0,
            height: 50.0,
            fit: BoxFit.fitHeight,
          ),
          Image(
            image: img,
            width: 100.0,
            height: 50.0,
            fit: BoxFit.scaleDown,
          ),
          Image(
            image: img,
            height: 50.0,
            width: 100.0,
            fit: BoxFit.none,
          ),
          Image(
            image: img,
            width: 100.0,
            color: Colors.blue,
            colorBlendMode: BlendMode.difference,
            fit: BoxFit.fill,
          ),
          Image(
            image: img,
            width: 100.0,
            height: 200.0,
            repeat: ImageRepeat.repeatY ,
          )

        ].map((e){
          return Row(
            children: <Widget>[
              Padding(
                padding: EdgeInsets.all(16.0),
                child: SizedBox(
                  width: 100,
                  child: e,
                ),
              ),

            ],
          );
        }).toList()] ,
    );


  }
}
